package com.lwgk.basic;
import android.app.ActionBar;
import android.os.Bundle;

import com.lwgk.R;
import com.lwgk.constant.ConstantUtils;
import com.lwgk.utils.SaveDataUtils;
import com.lwgk.utils.StatusBarUtils;

public abstract class BasicDayOrNeightActivity extends BasicActivity {

    private ActionBar mActionBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mActionBar = getActionBar();
        int data = (int) SaveDataUtils.getData(ConstantUtils.DAYORNIGHTCHANGE, 0);

        changeDayAndNoght(data);

    }

    /**
     * @param isNight 是否为夜间，夜间传1,正常模式1，活动界面模式是2
     */
    protected void  changeDayAndNoght(int isNight){

        if (isNight==1){
            //设置文字颜色是白色
            StatusBarUtils.setDarkMode(BasicDayOrNeightActivity.this);
            getActionBarView().setBackgroundColor(getResources().getColor(R.color.actionbar_night_color));
            getHandTitleLine().setBackgroundColor(getResources().getColor(R.color.actionbar_night_color));
        }else if (isNight==0){
            StatusBarUtils.setLightMode(BasicDayOrNeightActivity.this);
            getActionBarView().setBackgroundColor(getResources().getColor(R.color.white));
            getHandTitleLine().setBackgroundColor(getResources().getColor(R.color.white));
        }else if (isNight==2){

        }

    }

}
